package visam.core;

public class Edit
{
    public boolean stop;
    public int     pos;
    public Array   undotext;
    public Array   redotext;
    public Edit    next;
    
    Edit()
    {
        undotext = new Array(40);
        redotext = new Array(40);
    }
    
    public void setStop()
    {
        stop = true;
    }
    
    public boolean stop()
    {
        return stop == true;
    }
    
    public int getUndoLen()
    {
        return undotext.getSize();
    }
    
    public int getUndoEnd()
    {
        return pos + getUndoLen();
    }
    
    public int getRedoLen()
    {
        return redotext.getSize();
    }
    
    public int getRedoEnd()
    {
        return pos + getRedoLen();
    }
    
    public void dump()
    {
        System.out.println("{ pos: " + pos);
        System.out.print("undotext: ");
        undotext.dump();
        System.out.print("redotext: ");
        redotext.dump();
        System.out.println("}");
    }
}
